﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using DCM_Control;
using static DCM_Control.SQLData_Main;
using System.Data;
namespace 客户端_Xamarin
{
    public partial class MainPage : ContentPage
    {
        public MainPage()
        {
            InitializeComponent();
        }

        private void Button_Clicked_登录(object sender, EventArgs e)
        {
            try
            {
                设置网络连接();
                string S_用户名 = 用户名.Text;
                string S_密码 = 密码.Text;
                DataTable DT_This = SQL_Get_DataTable("用户视图", "用户名='" + S_用户名 + "'", Main.CN_Test);
            }
            catch (Exception ex)
            {
                DisplayAlert("提醒", ex.Message, "确定");
            }
        }
        private void 设置网络连接()
        {             
            ServerIP_Style = DCM.DCM_Enum.Enum_ServerIPStyle.IP_自定义;           
            DCM_Control.SQLData_Main.CaoZuoRen_BuMen = Main.CaoZuoRen_BuMen;
            DCM_Control.SQLData_Main.CaoZuoRen = Main.CaoZuoRen;
            DCM_Control.SQLData_Main.CaoZuoRen_ID = Main.CaoZuoRen_ID;
            DCM_Control.SQLData_Main.ServerIP = DCM.DCM_ServiceAbout.Get_DCMHL_ServerIP(ServerIP_Style, "179.18.0.200");
            DCM_Control.SQLData_Main.ServerPort = DCM.DCM_Const.ServerPort;
            DCM_Control.SQLData_Main.AppVersionNumber = new DCM.Stru_Version(Main.版本号);
            DCM_Control.SQLData_Main.CaoZuoRen_MAC = Main.CaoZuoRen_Mac;
        }

        private void 用户名_Completed(object sender, EventArgs e)
        {

        }

        private void 连接方式_CheckedChanged(object sender, int e)
        {

        }

        private void ToolbarItem_Clicked(object sender, EventArgs e)
        {

        }

        private void 忘记密码_Clicked(object sender, EventArgs e)
        {

        }
    }
}
